<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('服务器分页')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "tool/employee";
        var sexDatas = [[${@dict.getType('sys_user_sex')}]];
        var statusDatas = [[${@dict.getType('sys_normal_disable')}]];

        $(function() {
            var options = {
                url: prefix + "/client/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "员工",
		        showExport: true,
		        sidePagination: "client",
                columns: [{
		            checkbox: true
		        },
				{
					field : 'employeeId', 
					title : '员工ID',
					visible: false
				},
				{
					field : 'employeeCode', 
					title : '员工编号',
					sortable: true
				},
				{
					field : 'employeeName', 
					title : '员工姓名',
					sortable: true
				},
				{
                    field: 'employeeSex',
                    title: '员工性别',
                    align: 'center',
                    formatter: function(value, row, index) {
                    	return $.table.selectDictLabel(sexDatas, value);
                    }
                },
				{
					field : 'employeePhone', 
					title : '员工手机',
					sortable: true
				},
				{
					field : 'employeeEmail', 
					title : '员工邮箱',
					sortable: true
				},
				{
					field : 'employeeBalance', 
					title : '员工余额',
					sortable: true
				},
				{
                    field: 'status',
                    title: '员工状态',
                    align: 'center',
                    formatter: function(value, row, index) {
                    	return $.table.selectDictLabel(statusDatas, value);
                    }
                },
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs" href="#" onclick="$.operate.edit(\'' + row.employeeId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs" href="#" onclick="$.operate.remove(\'' + row.employeeId + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>